#ifndef OS_THREAD_H
#define OS_THREAD_H

typedef struct os_thread_s 
{
	void *thread_handle;
	long thread_pid;
}os_thread_t;

typedef struct os_mutex_s{
	void *handle;
}os_mutex_t;

typedef struct os_event_s{
	void *handle;
#ifdef WIN32
#else
	pthread_cond_t *cond;
	pthread_mutex_t *mutex;
#endif
}os_event_t;

int os_thread_create(int (*thread_func)(void *param), void *thread_param, os_thread_t **thread);
int os_thread_destroy(os_thread_t *thread);

int os_mutex_create(os_mutex_t **mutex);
int os_mutex_lock(os_mutex_t *mutex);
int os_mutex_unlock(os_mutex_t *mutex);
int os_mutex_destroy(os_mutex_t *mutex);

int os_event_create(os_event_t **event);
int os_event_wait(os_event_t *event, int miliseconds);
int os_event_set(os_event_t *event);
int os_event_destroy(os_event_t *event);

#endif
